define(["../logic/designer","../common/common"],function(pluginClass,c){
    return {
        pluginClass:pluginClass,
        style:{
            backgroundColor:c.bodyColor
        },
        nocache:true,
        root:["mainvlayout","personSelector"],
        components:{
            personSelector:{
              ref:true,
              type:"personselector"
            },
            mainvlayout:{
                type:"vbox",
                style:{
                  height:"100%",
                  width:"100%"
                },
                items:[
                  {
                    root:["main_header"],
                    style:{
                      height:"57px"
                    }
                  },

                  {
                    root:["main_body"],
                    style:{
                    }
                  }
                ]
            },

            main_header:{
              type:"hbox",
              className:"yy-unselect",
              style:{
                background:"#fff",
                borderBottom:"1px solid #eee",
                height:"100%",
                width:"100%",
                paddingRight:"20px"
              },
              items:[
                {
                  root:["title","next_title"],
                  style:{
                    verticalAlign:"middle",
                    width:200
                  }
                },
                {
                  root:["preview_btn","stop_btn","saveanduse_btn","save_btn"],
                  style:{
                    textAlign:"right",
                    verticalAlign:"middle",
                    width:"230px"
                  }
                }
              ]
            },
            preview_btn:{
              type:"button",
              title:"预览",
              style:{
                height:33,
                color:"#1FDA9A",
                borderColor:"#1FDA9A",
                marginRight:10
              }
            },
            stop_btn:{
              type:"button",
              title:"停用",
              className:"displaynone",
              ref:true,
              style:{
                height:33,
                color:"#1FDA9A",
                borderColor:"#1FDA9A",
                marginRight:10
              }
            },
            saveanduse_btn:{
              type:"button",
              ref:true,
              title:"保存并启用",
              style:{
                height:33,
                color:"#1FDA9A",
                borderColor:"#1FDA9A",
                marginRight:10
              }
            },
            save_btn:{
              ref:true,
              mode:2,
              style:{
                height:33,
                backgroundColor:"#1FDA9A"
              },
              type:"button",
              title:"保存"
            },
            title:{
              type:"text",
              text:"模板管理 ",
              style:{
                fontSize:16,
                color:"#999",
                display:"inline-block",
                marginLeft:20,
                cursor:"pointer"
              },
              nextTextStyle:{
                color:"#333"
              }
            },
            next_title:{
                type:"text",
                text:"> 设置日志模板",
                style:{
                    fontSize:16,
                    color:"#333",
                    display:"inline-block",
                    marginLeft:5
                }
            },
            main_body:{
              type:"hbox",
              className:"yy-unselect",
              style:{
                height:"100%",
                width:"100%",
                overflow:"hidden"
              },
              items:[
                {
                  root:["dailydesigner"],
                  style:{
                    backgroundColor:"#fff"
                  }
                },
                {
                  root:["segment","segment_statusview"],
                  style:{
                    width:250,
                    backgroundColor:"#fff"
                  }
                }
              ]
            },
            segment:{
              type:"repeat",
              ref:true,
              selectedMode:"s",
              items:[
                {
                  label:"控件设置"
                },
                {
                  label:"模板设置"
                }
              ],
              itemStyle:{
                float:"left",
                width:"50%",
                lineHeight:"40px",
                height:"100%",
                cursor:"pointer",
                textAlign:"center",
                color:"#999999",
              },

              style:{
                fontSize:14,
                height:40,
                lineHeight:"14px",
                backgroundColor:"#F7F7F7",
                overflow:"hidden"
              },
              itemSelectedClassName:"dc-segement-item-selected",
              root:["segment_label"]
            },
            segment_label:{
              type:"text",
              disableParentSelect:true,
              style:{
                display:"inline-block"
              },
              text_bind:"label"
            },
            segment_statusview:{
              ref:true,
              type:"statusview",
              style:{
                position:"absolute",
                top:40,
                padding:10,
                left:0,
                right:0,
                fontSize:14,
                bottom:0,
                overflow:"auto"
              },
              defaultKey:"template_wrap"
            },


            InputText_wrap:{
              type:"view",
              ref:true,
              style:{
                height:"100%",
              },
              root:["title_lable","InputText_title_input","InputText_placeholder_label","InputText_placeholder_textarea","InputText_require_checkbox"]
            },

            InputText_placeholder_label:{
              type:"text",
              text:"提示文字",
              style:{
                marginTop:6
              }
            },
            InputText_placeholder_textarea:c.getDesignPlaceHolder(),

            InputText_require_checkbox:c.getDesignRequireCheckBox(),


            InputText_title_input:c.getDesignInput(),


            InputDate_wrap:{
              type:"view",
              ref:true,
              style:{
                height:"100%",
              },
              root:["title_lable","InputDate_title_input","InputDate_require_checkbox"]
            },

            InputDate_require_checkbox:c.getDesignRequireCheckBox(),



            InputDate_title_input:c.getDesignInput(),


            InputCheckbox_wrap:{
              type:"view",
              ref:true,
              style:{
                height:"100%",
              },
              root:["title_lable","InputCheckbox_title_input","InputCheckbox_items_repeat_label","InputCheckbox_items_repeat","InputCheckbox_require_checkbox"]
            },
            InputCheckbox_items_repeat_label:{
              type:"text",
              text:"选项",
              nextTextStyle:{
                fontSize:12,
                color:"#999",
                marginLeft:2
              },
              style:{
                marginTop:6,
                marginBottom:6
              },
              nextText:"（至少2项最多10项）"
            },

            InputCheckbox_require_checkbox:c.getDesignRequireCheckBox(),


            InputCheckbox_items_repeat:{
              type:"repeat",
              ref:true,
              subComponent:"InputCheckbox_items_repeat_add_icon",
              root:["InputCheckbox_items_repeat_item"]
            },
            InputCheckbox_items_repeat_add_icon:{
              type:"icon",
              text:"添加选项",
              font:"icomoon_e901",
              iconStyle:{
                color:"#1FDA9A",
                marginRight:5
              },
              style:{
                cursor:"pointer",
                height:30,
                color:"#999",
                lineHeight:"30px",
                textAlign:"center",
                border:"1px solid #ccc",
                borderRadius:"4px",
                width:"100%"
              }
            },
            InputCheckbox_items_repeat_item:{
              type:"view",
              style:{
                marginBottom:6
              },
              root:["InputCheckbox_items_repeat_item_input","InputCheckbox_items_repeat_item_del"]
            },
            InputCheckbox_items_repeat_item_input:{
              type:"input",
              value_bind:"string",
              placeholder:"请填写选项名",
              style:{
                width:"100%",
                paddingRight:30
              }
            },
            InputCheckbox_items_repeat_item_del:{
              type:"icon",
              font:"icomoon_e91d",
              style:{
                position:"absolute",
                right:6,
                fontSize:20,
                zIndex:10,
                color:"#FF6E6E",
                height:32,
                lineHeight:"26px",
                cursor:"pointer",
                top:0
              }
            },

            InputCheckbox_title_input:c.getDesignInput(),


            InputRadio_wrap:{
              type:"view",
              ref:true,
              style:{
                height:"100%",
              },
              root:["title_lable","InputRadio_title_input","InputRadio_items_repeat_label","InputRadio_items_repeat","InputRadio_require_checkbox"]
            },

            InputRadio_items_repeat_label:{
              type:"text",
              text:"选项",
               nextTextStyle:{
                fontSize:12,
                color:"#999",
                marginLeft:2
              },
               style:{
                marginTop:6,
                marginBottom:6
              },
              nextText:"（至少2项最多10项）"
            },


            InputRadio_items_repeat:{
              type:"repeat",
              ref:true,
              subComponent:"InputRadio_items_repeat_add_icon",
              root:["InputRadio_items_repeat_item"]
            },
            InputRadio_items_repeat_add_icon:{
              type:"icon",
              text:"添加选项",
              font:"icomoon_e901",
              iconStyle:{
                color:"#1FDA9A",
                marginRight:5
              },
              style:{
                cursor:"pointer",
                height:30,
                color:"#999",
                lineHeight:"30px",
                textAlign:"center",
                border:"1px solid #ccc",
                borderRadius:"4px",
                width:"100%"
              }
            },
            InputRadio_items_repeat_item:{
              type:"view",
              style:{
                marginBottom:6
              },
              root:["InputRadio_items_repeat_item_input","InputRadio_items_repeat_item_del"]
            },
            InputRadio_items_repeat_item_input:{
              type:"input",
              value_bind:"string",
              placeholder:"请填写选项名",
              style:{
                width:"100%",
                paddingRight:30
              }
            },
            InputRadio_items_repeat_item_del:{
              type:"icon",
              font:"icomoon_e91d",
              style:{
                position:"absolute",
                right:6,
                fontSize:20,
                zIndex:10,
                color:"#FF6E6E",
                height:32,
                lineHeight:"26px",
                cursor:"pointer",
                top:0
              }
            },


            InputRadio_require_checkbox:c.getDesignRequireCheckBox(),


            InputRadio_title_input:c.getDesignInput(),

             InputTextNum_wrap:{
              type:"view",
              ref:true,
              style:{
                height:"100%",
              },
              root:["title_lable","InputTextNum_title_input","InputTextNum_placeholder_label","InputTextNum_placeholder_textarea","unit_label","unit_label_input","InputTextNum_require_checkbox"]
            },

            InputTextNum_require_checkbox:c.getDesignRequireCheckBox(),

            InputTextNum_title_input:c.getDesignInput(),

            unit_label_input:{
              type:"input",
              ref:true,
              placeholder:"请输入单位比如(元)",
              style:{
                marginTop:6,
                width:"100%"
              }
            },
            unit_label:{
              type:"text",
              text:"单位",
              style:{
                marginTop:6
              }
            },

            InputTextNum_placeholder_label:{
              type:"text",
              text:"提示文字",
              style:{
                marginTop:6
              }
            },
            InputTextNum_placeholder_textarea:c.getDesignPlaceHolder(),


            title_lable:{
              type:"text",
              text:"标题"
            },

             template_wrap:{
              type:"view",
              ref:true,
              style:{
                height:"100%"
              },
              root:["template_wrap_name","template_wrap_name_input","template_wrap_desc","template_wrap_desc_input","template_wrap_range","template_wrap_range_wrap","template_wrap_type","template_wrap_type_repeat"]
            },
            template_wrap_name:{
              type:"text",
              text:"模板名称",
              style:{
                  color:"#666666"
              },
              nextText:"*",
              nextTextStyle:{
                color:"#FF4E5B"
              }
            },
            template_wrap_name_input:{
              type:"input",
              ref:true,
              placeholder:"不超过10个字",
              style:{
                marginTop:6,
                width:"100%"
              }
            },
            template_wrap_desc:{
              type:"text",
              text:"模板说明",
              style:{
                color:"#666666",
                marginTop:16
              }
            },
             template_wrap_desc_input:{
              type:"input",
              ref:true,
              placeholder:"不超过20个字",
              style:{
                marginTop:6,
                width:"100%"
              }
            },
            template_wrap_range:{
              type:"text",
              text:"可见范围",
              style:{
                color:"#666666",
                marginTop:6
              }
            },
            template_wrap_range_wrap:{
              type:"hbox",
              className:"ds-person-selector",
              style:{
                cursor:"pointer",
                minHeight:30,
                border:"1px solid #ccc",
                borderRadius:"4px",
                width:"100%",
                marginTop:6
              },
              items:[
                {root:["tips_repeat"],style:{verticalAlign:"middle"}},
                {root:["template_wrap_range_icon"],style:{
                  width:26
                }}
              ]
            },
            repeat_nodata:{
              type:"text",
              ref:true,
              text:"所有人可见"
            },
            tips_repeat:{
              ref:true,
                type:"repeat",
                nodata:"repeat_nodata",
                style:{
                    color:"#a6a8a9",
                    fontSize:"12px",
                    overflow:"hidden",
                    padding:4
                },

                root:["repeat_item"],
                itemStyle:{
                  float:"left",
                  backgroundColor:"#F5F5F5",
                  borderRadius:"12px",
                  paddingLeft:8,
                  paddingRight:8,
                  marginBottom:4,
                  paddingBottom:2,
                  marginRight:"3px"
                }
            },
            repeat_item:{
              type:"icon",
              textPos:"left",
              font:"icomoon_e90a",
              iconStyle:{
                color:"#c8c8c8",
                marginLeft:5
              },
              style:{
                color:"#666666"
              },

              text_bind:"name"
            },
            template_wrap_range_icon:{
              type:"icon",
              ref:true,
              style:{
                top:2
              },
              iconStyle:{
                fontSize:20,
                color:"#AAAAAA"
              },
              font:"icomoon_e90b"
            },

            template_wrap_type:{
              type:"text",
              text:"模板类型",
              style:{
                color:"#666666",
                marginTop:6
              }
            },
            template_wrap_type_repeat:{
              type:"repeat",
              ref:true,
              selectedMode:"s",
              items:[
                {label:"日报",id:1},
                {label:"周报",id:2},
                {label:"月报",id:3},
                {label:"其他",id:4}
              ],
              itemStyle:{
                width:"33.3%",
                float:"left",
                marginTop:5
              },
              root:["template_wrap_item"]
            },
            template_wrap_item:{
              type:"icon",
              ref:true,
              selectedClassName:"template-wrap-item-selected",
              style:{
                cursor:"pointer"
              },
              font:"icomoon_e912",
              iconStyle:{
                fontSize:18,
                color:"#DDDDDD"
              },
              textStyle:{
                marginLeft:5,
                color:"#666666",
                fontSize:13,
                lineHeight:"13px"
              },
              text_bind:"label"
            },

            noctl_wrap:{
              type:"view",
              style:{
                height:"100%",
                textAlign:"center"
              },
              root:["noctl_icon"]
            },

            noctl_icon:{
              type:"icon",
              src:"./imgs/controller_empty.png",
              text:"还没有控件哦～请选择控件",
              textPos:"bottom",
              iconStyle:{
                  width:74,
                  margin: "0 auto"
              },
              textStyle:{
                color:"#666666",
                marginTop:30
              },
              style:{
                display:"inline-block",
                marginTop:130
              }
            },




            dailydesigner:{
              ref:true,
              type:"dailydesigner"
            },

            save_success_dialog: {
                type: 'view',
                style: {
                    backgroundColor: "#fff",
                    overflow: "hidden",
                    borderRadius: "4px",
                    width: "300px",
                    paddingTop: "60px",
                    paddingBottom: "10px",
                    margin: "auto"
                },
                root: ["save_success_dialog_label", "save_success_dialog_btn_wrap"]
            },
            save_success_dialog_label: {
                type: "text",
                style: {
                    textAlign: "center",
                    fontSize: "16px",
                    color: "#666666"
                },
                text: "保存成功!"
            },
            save_success_dialog_btn_wrap: {
                type: "view",
                style: {
                    marginTop: "50px",
                    textAlign: "center"
                },
                root: ["save_success_dialog_okbtn","save_success_dialog_cancelbtn"]
            },
            save_success_dialog_cancelbtn: {
                type: 'button',
                mode: 1,
                style: {
                    width: "120px",
                    height: "38px",
                    lineHeight: "38px",
                    border: "1px solid #eeeeee",
                    color: "#666666",
                    fontSize: "14px"
                },
                title: "继续编辑"
            },
            save_success_dialog_okbtn: {
                type: 'button',
                mode: 2,
                ref: true,
                style: {
                    width: "120px",
                    height: "38px",
                    lineHeight: "38px",
                    fontSize: "14px",
                    marginRight: "10px"
                },
                title: "返回模版管理"
            },

        }
    };
});
